from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from rest_framework.routers import DefaultRouter

from snippets import views

urlpatterns = [
    url(r'^$', views.api_root),
    url(r'^test/$', views.TestView.as_view()),
    url(r'^upload/(?P<filename>[^/]+)$', views.FileUploadView.as_view())
]

urlpatterns = format_suffix_patterns(urlpatterns)

router = DefaultRouter()
router.register(r'users', views.UserViewSet, basename='user')
router.register(r'album', views.AlbumViewSet, basename='album')
router.register(r'track', views.TrackViewSet, basename='track')

urlpatterns += router.urls
